Dear All,
Thank you sincerely for helping me. I read one stata programing book and am struck by the following syntax. I underlined it. How to understand it and why we need to use
des srate infla ss
sum srate infla ss
local vv srate infla ss*
foreach v of varlist `vv'{
local a: var label `v'
if ("`v'"=="infla"|"`v'"=="srate"){
winsor `v', p(0.02) gen(`v'_x)
}
else{
winsor `v',p(0.01) gen(`v'_x)
}
drop `v'
rename `v'_x `v'
label var `v' "`a'"
}
Best Regards,
Eddie
Thank you sincerely for helping me. I read one stata programing book and am struck by the following syntax. I underlined it. How to understand it and why we need to use
colons in that syntax? I rarely met syntax using colons before, and when shall we need to use it?
des srate infla ss
sum srate infla ss
local vv srate infla ss*
foreach v of varlist `vv'{
local a: var label `v'
if ("`v'"=="infla"|"`v'"=="srate"){
winsor `v', p(0.02) gen(`v'_x)
}
else{
winsor `v',p(0.01) gen(`v'_x)
}
drop `v'
rename `v'_x `v'
label var `v' "`a'"
}
Best Regards,
Eddie
Comment